home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_01 / command.h < prev    next >
C/C++ Source or Header  |  1993-11-15  |  29KB  |  358 lines

  1. /*
  2.  * THE - The Hessling Editor. A text editor similar to VM/CMS xedit.
  3.  * Copyright (C) 1991-1993 Mark Hessling
  4.  *
  5.  * This program is free software; you can redistribute it and/or
  6.  * modify it under the terms of the GNU General Public License as
  7.  * published by the Free Software Foundation; either version 2 of
  8.  * the License, or any later version.
  9.  *
  10.  * This program is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13.  * General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program; if not, write to:
  17.  *
  18.  *    The Free Software Foundation, Inc.
  19.  *    675 Mass Ave,
  20.  *    Cambridge, MA 02139 USA.
  21.  *
  22.  *
  23.  * If you make modifications to this software that you feel increases
  24.  * it usefulness for the rest of the community, please email the
  25.  * changes, enhancements, bug fixes as well as any and all ideas to me.
  26.  * This software is going to be maintained and enhanced as deemed
  27.  * necessary by the community.
  28.  *
  29.  * Mark Hessling                     email: M.Hessling@gu.edu.au
  30.  * 36 David Road                     Phone: +61 7 849 7731
  31.  * Holland Park                      Fax:   +61 7 875 5314
  32.  * QLD 4121
  33.  * Australia
  34.  */
  35.  
  36. /*
  37. $Header: C:\THE\RCS\command.h 1.4 1993/09/01 16:25:48 MH Interim MH $
  38. */
  39.  
  40. struct commands
  41. {
  42.  char *text;
  43.  unsigned short min_len;
  44.  unsigned int funkey;
  45. #ifdef PROTO
  46.  int (*function)(char *);
  47. #else
  48.  int (*function)();
  49. #endif
  50.  bool valid_profile_command;
  51.  bool set_command;
  52.  bool sos_command;
  53.  bool strip_param;
  54.  char *params;
  55. };
  56. typedef struct commands COMMAND;
  57.  
  58. #include "proto.h"
  59.  
  60. /*---------------------- *** IMPORTANT *** ----------------------------*/
  61. /* Make sure that there is no chance two or more commands can be       */
  62. /* matched based on number of significant charcters.                   */
  63. /*---------------------- *** IMPORTANT *** ----------------------------*/
  64. /*                                                                  Prof / Set / SOS /strip */
  65. COMMAND command[] =
  66. {
  67.  {(char *)"add",         3,  (-1),            Add,         TRUE, FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  68.  {(char *)"all",         3,  (-1),            All,         TRUE, FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  69.  {(char *)"arbchar",     3,  (-1),            Arbchar,     TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  70.  {(char *)"autosave",    2,  (-1),            Autosave,    TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  71.  {(char *)"backup",      4,  (-1),            Backup,      TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  72.  {(char *)"beep",        4,  (-1),            BeepSound,   TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  73. #if defined(DOS) || defined(OS2)
  74.  {(char *)"backward",    2,  KEY_PGUP,        Backward,    FALSE,FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  75. #else
  76.  {(char *)"backward",    2,  KEY_PPAGE,       Backward,    FALSE,FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  77.  {(char *)"backward",    2,  KEY_PrevScrn,    Backward,    FALSE,FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  78. #endif
  79.  {(char *)"bottom",      3,  (-1),            Bottom,      TRUE, FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  80.  {(char *)"cancel",      3,  (-1),            Cancel,      TRUE, FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  81.  {(char *)"case",        4,  (-1),            Case,        TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  82.  {(char *)"ccancel",     2,  (-1),            Ccancel,     TRUE, FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  83.  {(char *)"change",      1,  (-1),            Change,      TRUE, FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  84.  {(char *)"clearscreen", 6,  (-1),            Clearscreen, TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  85.  {(char *)"clock",       5,  (-1),            Clock,       TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  86. #if defined(DOS) || defined(OS2)
  87.  {(char *)"cmatch",      0,  KEY_F7,          Cmatch,      FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  88. #else
  89.  {(char *)"cmatch",      0,  KEY_F(7),        Cmatch,      FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  90. #endif
  91.  {(char *)"cmdarrows",   4,  (-1),            Cmdarrows,   TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  92.  {(char *)"cmdline",     3,  (-1),            Cmdline,     TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  93.  {(char *)"cmsg",        4,  (-1),            Cmsg,        FALSE,FALSE,FALSE,FALSE,(char *)""},  /* comm1.c */
  94.  {(char *)"command",     7,  (-1),            Command,     TRUE, FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  95.  {(char *)"colour",      6,  (-1),            Colour,      TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  96.  {(char *)"color",       5,  (-1),            Colour,      TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  97.  {(char *)"copy",        4,  (-1),            Copy,        FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  98. #if defined(DOS) || defined(OS2)
  99.  {(char *)"control_char",0,  KEY_F12,         Control_char,FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  100.  {(char *)"copy",        0,  KEY_A_c,         Copy,        FALSE,FALSE,FALSE,TRUE, (char *)"block reset"},  /* comm1.c */
  101.  {(char *)"copy",        0,  KEY_A_k,         Copy,        FALSE,FALSE,FALSE,TRUE, (char *)"block"},  /* comm1.c */
  102. #else
  103.  {(char *)"control_char",0,  KEY_F(6),        Control_char,FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  104.  {(char *)"copy",        0,  ControlC,        Copy,        FALSE,FALSE,FALSE,TRUE, (char *)"block reset"},  /* comm1.c */
  105.  {(char *)"copy",        0,  ControlK,        Copy,        FALSE,FALSE,FALSE,TRUE, (char *)"block"},  /* comm1.c */
  106. #endif
  107.  {(char *)"curline",     4,  (-1),            Curline,     TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  108.  {(char *)"define",      3,  (-1),            Define,      TRUE, FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  109.  {(char *)"delete",      3,  (-1),            DeleteLine,  TRUE, FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  110. #if defined(DOS) || defined(OS2)
  111.  {(char *)"delete",      0,  KEY_A_g,         DeleteLine,  FALSE,FALSE,FALSE,TRUE, (char *)"block"}, /* comm1.c */
  112. #else
  113.  {(char *)"delete",      0,  ControlG,        DeleteLine,  FALSE,FALSE,FALSE,TRUE, (char *)"block"}, /* comm1.c */
  114. #endif
  115.  {(char *)"directory",   3,  (-1),            Directory,   FALSE,FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  116.  {(char *)"dirinclude",  4,  (-1),            Dirinclude,  TRUE, TRUE, FALSE,TRUE, (char *)"*"}, /* commset1.c */
  117.  {(char *)"ls",          2,  (-1),            Directory,   FALSE,FALSE,FALSE,TRUE, (char *)"1"}, /* comm1.c */
  118.  {(char *)"display",     4,  (-1),            Display,     TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  119.  {(char *)"down",        1,  (-1),            Next,        TRUE, FALSE,FALSE,TRUE, (char *)"1"}, /* comm3.c */
  120.  {(char *)"duplicate",   3,  (-1),            Duplicate,   TRUE, FALSE,FALSE,TRUE, (char *)""},  /* comm2.c */
  121. #if defined(DOS) || defined(OS2)
  122.  {(char *)"down_arrow",  0,  KEY_CURD,        Down_arrow,  FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  123.  {(char *)"duplicate",   0,  KEY_A_d,         Duplicate,   TRUE, FALSE,FALSE,TRUE, (char *)"1 BLOCK"},  /* comm2.c */
  124. #else
  125.  {(char *)"down_arrow",  0,  KEY_DOWN,        Down_arrow,  FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm1.c */
  126.  {(char *)"duplicate",   0,  ControlD,        Duplicate,   TRUE, FALSE,FALSE,TRUE, (char *)"1 BLOCK"},  /* comm2.c */
  127.  {(char *)"enter",       0,  ControlM,        Enter,       FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm2.c */
  128.  {(char *)"enter",       0,  KEY_ENTER,       Enter,       FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm2.c */
  129. #endif
  130.  {(char *)"enter",       0,  KEY_RETURN,      Enter,       FALSE,FALSE,FALSE,TRUE, (char *)""},  /* comm2.c */
  131.  {(char *)"emsg",        4,  (-1),            Emsg,        TRUE, FALSE,FALSE,FALSE,(char *)""},  /* comm2.c */
  132.  {(char *)"eolout",      4,  (-1),            Eolout,      TRUE, TRUE, FALSE,TRUE, (char *)""},  /* commset1.c */
  133.  {(char *)"etmode",      6,  (-1),            Etmode,      TRUE, T